package com.xiyue.leaspring.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xiyue.leaspring.dao.IDeptDAO_CrudRepository;
import com.xiyue.leaspring.po.Dept;
import com.xiyue.leaspring.service.IDeptService_CrudRepository;

@Service
public class IDeptServiceImpl_CrudRepository implements IDeptService_CrudRepository {

	@Autowired
	private IDeptDAO_CrudRepository iDeptDAO_CrudRepository;
	
	@Override
	public boolean add(Dept vo) {
		// TODO Auto-generated method stub
		return this.iDeptDAO_CrudRepository.save(vo) != null;
	}

	@Override
	public List<Dept> list() {
		// TODO Auto-generated method stub
		return (List<Dept>) this.iDeptDAO_CrudRepository.findAll();
	}

	@Override
	public Dept get(Long id) {
		// TODO Auto-generated method stub
		return this.iDeptDAO_CrudRepository.findById(id).get();
	}

}
